From 31cf2fef2deb4c19f3b6b59c6b5e68f93c8c658e Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Fri, 24 Oct 2008 18:54:02 +0000 Subject: [PATCH] API: Partial fix of bug 16076: use pl_from instead of page_id in list=backlinks query. The two are equal because of the JOIN clause, but pl_from is indexed whereas page_id isn't (MySQL 5 automatically rewrites this, 4 doesn't) --- includes/api/ApiQueryBacklinks.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/api/ApiQueryBacklinks.php b/includes/api/ApiQueryBacklinks.php index a9534512b8..efc1a91b16 100644 --- a/includes/api/ApiQueryBacklinks.php +++ b/includes/api/ApiQueryBacklinks.php @@ -113,7 +113,7 @@ class ApiQueryBacklinks extends ApiQueryGeneratorBase { $this->addWhereFld($this->bl_ns, $this->rootTitle->getNamespace()); $this->addWhereFld('page_namespace', $this->params['namespace']); if(!is_null($this->contID)) - $this->addWhere("page_id>={$this->contID}"); + $this->addWhere("pl_from>={$this->contID}"); if($this->params['filterredir'] == 'redirects') $this->addWhereFld('page_is_redirect', 1); if($this->params['filterredir'] == 'nonredirects') @@ -147,7 +147,7 @@ class ApiQueryBacklinks extends ApiQueryGeneratorBase { $this->addWhere($titleWhere); $this->addWhereFld('page_namespace', $this->params['namespace']); if(!is_null($this->redirID)) - $this->addWhere("page_id>={$this->redirID}"); + $this->addWhere("pl_from>={$this->redirID}"); if($this->params['filterredir'] == 'redirects') $this->addWhereFld('page_is_redirect', 1); if($this->params['filterredir'] == 'nonredirects') -- 2.20.1